// getTodos --> getComments --> getAlbums

function  getTodos() {
    return new Promise((resolve)=>{
        console.log("getTodos")
        resolve()
    })
}
function getComments() {
    return new Promise((resolve)=>{
        console.log("getComments")
        resolve()
    })
}
function getAlbums() {
    return new Promise((resolve)=>{
        
        setTimeout(()=>{
            console.log("getAlbums")
        resolve()
        },3000)
    })
}
function  run(promisesFn) {
    let x = Promise.resolve()
    for(const fn of promisesFn){
        x = x.then(()=>fn())
    }
}
run([getTodos,getAlbums,getComments])